package h0807;

import java.util.*;

public class PrintTaskSort2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] priorities = Arrays.stream(sc.nextLine().split(",")).mapToInt(Integer::parseInt).toArray();

        int[] temp =Arrays.copyOfRange(priorities,0,priorities.length);

        //
        Integer[] array = Arrays.stream(temp).boxed().sorted(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        }).toArray(Integer[]::new);
        //是否被使用
        boolean[] used = new boolean[temp.length];

        StringJoiner joiner=new StringJoiner(",");
        for (int priority : priorities) {
            for (int i = 0; i < array.length; i++) {
                if (array[i]==priority&&!used[i]){
                    joiner.add(i+"");
                    used[i]=true;
                    break;
                }
            }
        }
        System.out.println(joiner);
    }
}
